home *** CD-ROM | disk | FTP | other *** search
Text File | 1992-06-19 | 1.8 KB | 114 lines | [TEXT/MPS ] |
- #define SystemSevenOrLater 1
-
- #include <errors.h>
-
- #include "aelist.h"
- #include "templock.h"
-
- void aelist::append( DescType type,
- void *data,
- uint32 size )
- {
- if (iswrong())
- return;
-
- error= AEPutPtr( this,
- 0,
- type,
- (Ptr)data,
- size );
- }
-
- void aelist::append( DescType type,
- Handle h )
- {
- if (iswrong())
- return;
-
- templock lock(h);
-
- append( type, *h, GetHandleSize(h) );
- }
-
- void aelist::append( const AEDesc& item )
- {
- if (iswrong())
- return;
-
- error= AEPutDesc( this, 0, &item );
- }
-
- uint32 aelist::countitems()
- {
- uint32 count;
- error= AECountItems( this, (long *)&count );
- return count;
- }
-
- OSErr aelist::getnth( uint32 index,
- DescType desired,
- AEKeyword& key,
- DescType& actualtype,
- void *data,
- uint32 maxsize,
- uint32& truesize )
- {
- if (iswrong())
- return whatiswrong();
-
- return AEGetNthPtr( this,
- index,
- desired,
- &key,
- &actualtype,
- (Ptr)data,
- maxsize,
- (Size *)&truesize );
- }
-
- OSErr aelist::getnth( uint32 index,
- DescType desired,
- AEKeyword& key,
- DescType& actualtype,
- Handle& result )
- {
- uint32 size;
- OSErr error= getnth( index,
- desired,
- key,
- actualtype,
- 0,
- 0,
- size );
- if ( error != noErr )
- return error;
-
- result= NewHandle(size);
- if ( result==0 )
- return mFulErr;
-
- templock lock(result);
- return getnth( index,
- desired,
- key,
- actualtype,
- 0,
- 0,
- size );
- }
-
- OSErr aelist::getnth( uint32 index,
- DescType desired,
- AEKeyword& key,
- AEDesc& result )
- {
- if (iswrong())
- return whatiswrong();
-
- return AEGetNthDesc( this,
- index,
- desired,
- &key,
- &result );
- }
-